<template>
  <hz-dialog v-model="dialogConfig.show" :title="dialogConfig.title">

    <slot name="before"></slot>

    <commission ref="commissionRef" :dataObj="dataObj"></commission>

    <slot name="after"></slot>

    <div class="dialog-footer my-dialog-foot">
      <hz-button type="primary" @click="clickSubmit">确定</hz-button>
      <hz-button @click="dialogConfig.show = false">取消</hz-button>
    </div>
  </hz-dialog>
</template>
<script setup>
import { ref, reactive, computed, getCurrentInstance } from "vue";
import { useStore } from "vuex";
import commission from "@/components/commission/commission.vue";

const store = useStore();
const { proxy } = getCurrentInstance();
const props = defineProps({
  dialogConfig: {
    show: true,
    title: '弹窗标题',
  },
  dataObj: Object,
});
const emits = defineEmits(['submitEditFood'])
const commissionRef = ref(null);

/* ---------methods--------- */


// 点击确定，提交数据
function clickSubmit() {
  let data = commissionRef.value.getData();
  emits('submitEditFood', data)
}

</script>

<style lang="scss" scoped></style>
